/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DataModel;

import java.util.Arrays;
import java.util.Objects;

/**
 *
 * @author Tomasz Nowak
 */
public class NotaryCertificate
{
	private String name;
	private byte[] publicKey;

	public NotaryCertificate( String name, byte[] publicKey )
	{
		this.name = name;
		this.publicKey = publicKey;
	}

	public String getName()
	{
		return name;
	}

	public void setName( String name )
	{
		this.name = name;
	}

	public byte[] getPublicKey()
	{
		return publicKey;
	}

	public void setPublicKey( byte[] publicKey )
	{
		this.publicKey = publicKey;
	}

	@Override
	public int hashCode()
	{
		int hash = 5;
		hash = 73 * hash + Objects.hashCode(this.name);
		hash = 73 * hash + Arrays.hashCode(this.publicKey);
		return hash;
	}

	@Override
	public boolean equals( Object obj )
	{
		if ( obj == null )
		{
			return false;
		}
		if ( getClass() != obj.getClass() )
		{
			return false;
		}
		final NotaryCertificate other = ( NotaryCertificate ) obj;
		if ( !Objects.equals(this.name, other.name) )
		{
			return false;
		}
		if ( !Arrays.equals(this.publicKey, other.publicKey) )
		{
			return false;
		}
		return true;
	}

}
